﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Koonsoft.HYCRM.BLL;
using Koonsoft.HYCRM.Model;

public partial class Auditors_DelegateTask : BasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        if (DropDownList1.Items.Count > 0)
        {
            var orderID = Request.QueryString["OrderID"].Trim();
            int empolyeeID = Convert.ToInt32(DropDownList1.SelectedValue);

            try
            {
                new CompanyBLL().UpdateCompanyAuditorsStatuc(orderID, (int)AuditorsStatus.Assigned,Page.User.Identity.Name);
                new AuditorsBLL().CreateAccountantDelegate(orderID, empolyeeID);
                AlterAndRedirect("指派成功", "CompanyAuditorsDelegate.aspx");
            }
            catch
            {
                AlterAndRedirect("指派失败", "CompanyAuditorsDelegate.aspx");
            }
        }
    }
}